﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Crd4011b.aspx.cs" Inherits="Updms.Crd.Crd4011b" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Crd4011b] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->	
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Crd4011b" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClientClick="return chkSearch(event)" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="15%"><a href="javascript:void(0);" title="전체선택/해제" onclick="checkBoxCheckTable('cbl_search_card_cd')"><u><asp:Literal id="ltr_search_card_cd" Text="카드" runat="server" /></u></a></td>
					<td class="ctl" width="85%"><asp:CheckBoxList id="cbl_search_card_cd" runat="server" RepeatDirection="Horizontal" CssClass="cbl_flow"></asp:CheckBoxList></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal id="ltr_search_contents" Text="내용" runat="server" /><asp:Literal id="ltr_search_contents_cnt" Text="" runat="server" /></td>
					<td class="ctl"><asp:dropdownlist id="ddl_search_contents" runat="server" CssClass="ddl" Width="50%"></asp:dropdownlist><asp:LinkButton ID="lbtn_refresh" OnClick="lbtn_refresh_Click" runat="server"><img src="../Common/Images/arrow_refresh_small.png" align="middle" style="margin:-8px 0 0 0" alt="Refresh" /></asp:LinkButton></td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일 시작 -->
			<table class="table_detail">
				<tr>
					<td class="lbl" width="15%"><asp:Literal id="ltr_latitude_longitude" Text="위도/경도" runat="server" /></td>
					<td class="ctl" width="20%">
						<ul class="horizontal">
							<li style="width:44%;"><asp:textbox id="txt_latitude" runat="server" CssClass="ib_b req" Width="96%"></asp:textbox></li>
							<li style="width:1%;">&nbsp;</li>
							<li style="width:44%;"><asp:textbox id="txt_longitude" runat="server" CssClass="ib_b req" Width="100%"></asp:textbox></li>
							<li style="width:3%;">&nbsp;</li>
							<li style="width:8%;"><img src="../Common/Images/map.png" align="absmiddle" alt="map" class="hand" onclick="showNaverMapEdit();" /></li>
						</ul>
					</td>
					<td width="65%"></td>
				</tr>
			</table>
			<!-- 디테일 끝 -->
			<!-- 리스트셋 시작 -->
			<table id="table_list_set" cellpadding="0" cellspacing="0" border="0" width="100%" runat="server">
				<tr>
					<td>
						<!-- 검색어 시작 -->
						<div class="div_left">Keyword : <asp:label id="lbl_search_keyword" runat="server"></asp:label></div>
						<!-- 검색어 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 리스트 시작 -->
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" DataKeyNames="Seq,Card_Cd,Biz_Div">
							<Columns>
								<asp:TemplateField HeaderText="&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;checkBoxCheck('GridView1');&quot;&gt;S&lt;/a&gt;">
									<ItemTemplate>
										<input id="cb_check" class="cb" type="checkbox" onclick="reverseRow('GridView1', 0);" runat="server" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="2%" />
								</asp:TemplateField>
								<asp:BoundField HeaderText="번호" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="False" />
								<asp:BoundField DataField="Card_Cd" HeaderText="Card_Cd(X)" Visible="False" />
								<asp:BoundField DataField="Card_Nm" HeaderText="카드" HtmlEncode="False" >
									<ItemStyle Width="10%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:BoundField DataField="Biz_Div" HeaderText="Biz_Div(X)" Visible="False" />
								<asp:BoundField DataField="Biz_Div_Nm" HeaderText="결제구분" HtmlEncode="False" >
									<ItemStyle Width="8%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:TemplateField HeaderText="결제내용">
									<ItemTemplate>
										<asp:LinkButton ID="lbtn_rc" runat="server" Text='<%# Bind("Contents") %>'></asp:LinkButton>
									</ItemTemplate>
									<HeaderStyle CssClass="lbtn_rc" />
									<ItemStyle HorizontalAlign="Left" Width="22%" />
								</asp:TemplateField>
								<asp:BoundField DataField="Biz_Dt" HeaderText="카드사용일" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Remark" HeaderText="비고" HtmlEncode="False" >
									<ItemStyle HorizontalAlign="Left" Width="30%" />
								</asp:BoundField>
								<asp:BoundField DataField="Latitude" HeaderText="위도" >
									<ItemStyle HorizontalAlign="Center" Width="7%" />
								</asp:BoundField>
								<asp:BoundField DataField="Longitude" HeaderText="경도" >
									<ItemStyle HorizontalAlign="Center" Width="7%" />
								</asp:BoundField>
								<asp:BoundField DataField="NaverMap_Link" HeaderText="위치" HtmlEncode="False" >
									<HeaderStyle Font-Underline="True" />
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 리스트 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 페이징 시작 -->
						<div class="div_left">Result : <asp:label id="lbl_result_count" runat="server"></asp:label></div>
						<!-- 페이징 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
			<asp:label id="lbl_seq_mass" runat="server"></asp:label>
			<asp:label id="lbl_seq_ins" runat="server"></asp:label>
			<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
			<input id="h_no" type="hidden" name="h_no" runat="server" />
			</div>
			<!-- 히든값 끝 -->
			<act:FilteredTextBoxExtender ID="fte_latitude"
				runat="server"
				TargetControlID="txt_latitude"
				FilterType="Numbers">
			</act:FilteredTextBoxExtender>
			<act:FilteredTextBoxExtender ID="fte_longitude"
				runat="server"
				TargetControlID="txt_longitude"
				FilterType="Numbers">
			</act:FilteredTextBoxExtender>
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>	
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//검색
	function chkSearch(evt) {
		var lb_checked_card = false;
		var e = (!evt) ? window.event : evt;
		var keyCode = e.keyCode;
		
		//체크박스 갯수
		var cb_cnt_card = getCheckBoxCntOnTable("cbl_search_card_cd");
		
		//카드체크여부
		for (var i=0; i<cb_cnt_card; i++) {
			var cb = $("cbl_search_card_cd_"+i);
			if (cb.checked) {
				lb_checked_card = true;
			}
		}
		
		if (!lb_checked_card){
			msgBox.alert(getMsg(MSG_ERR_023), null, null, keyCode); //하나이상의 카드를 선택하세요
			return false;
		}

		if ($F("txt_search_contents").blank()) {
			msgBox.alert(getMsg(MSG_ERR_034), setFocus, "txt_search_contents"); //결제내용을 입력해 주세요
			return false;
		}
		
		return true;
	}

	//저장
	function chkSave() {
		if ($F("txt_latitude").blank()) {
			msgBox.alert(getMsg(MSG_ERR_168), setFocus, "txt_latitude"); //위도를 입력해 주세요
			return false;
		}

		if ($F("txt_longitude").blank()) {
			msgBox.alert(getMsg(MSG_ERR_169), setFocus, "txt_longitude"); //경도를 입력해 주세요
			return false;
		}

		if (!isCheckedOnGridView("GridView1", 0)) {
			msgBox.alert(getMsg(MSG_ERR_085)); //저장할 항목을 선택하세요
			return false;
		}

		msgBox.confirm(getMsg(MSG_CFM_000), doSave); //저장하시겠습니까?
		return false;
	}

	//지도팝업
	function showNaverMapEdit() {
		goNaverMapEdit($F("txt_latitude"), $F("txt_longitude"), "txt_latitude", "txt_longitude");
	}
</script>
</body>
</html>